#include "sensor_adjust.h"
#include "ui_sensor_adjust.h"
#include "main.h"


sensor_adjust::sensor_adjust(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::sensor_adjust)
{

    ui->setupUi(this);

}

sensor_adjust::~sensor_adjust()
{
    delete ui;
}

void sensor_adjust::entrance()
{
    ui->HtemlineEdit->setText(QString::number(high_temperature_adjust));
    ui->pPSU->setText(QString::number(positive_pressure_adjust));
    ui->nPSU->setText(QString::number(negative_pressure_adjust));
    ui->normal_PSU->setText(QString::number(normal_pressure_adjust));
    ui->high_balance->setText(QString::number(high_balance));
    ui->low_balance->setText(QString::number(low_balance));
    ui->MtemlineEdit->setText(QString::number(mid_temperature_adjust));
    ui->LtemlineEdit->setText(QString::number(low_temperature_adjust));
    showFullScreen();

}

void sensor_adjust::on_buttonBox_accepted()
{
    getvalue();
    config_changed=true;
}


void sensor_adjust::getvalue()
{
        positive_pressure_adjust=ui->pPSU->text().toInt();
        negative_pressure_adjust=ui->pPSU->text().toInt();
        normal_pressure_adjust=ui->normal_PSU->text().toInt();
        high_balance=ui->high_balance->text().toInt();
        low_balance=ui->low_balance->text().toInt();
        high_temperature_adjust=ui->HtemlineEdit->text().toInt();
        mid_temperature_adjust=ui->MtemlineEdit->text().toInt();
        low_temperature_adjust=ui->LtemlineEdit->text().toInt();

}
